<?php

class Soul_Validation_Rule_Integer extends Soul_Validation_Rule_Base {

    public function __construct(){
        parent::__construct();
    }

    public function getType() {
        return 'integer';
    }

    public function check($value) {
        if(is_int($value)){
            return TRUE;
        }

        return preg_match("/^[1-9]\d*|[0-9]$/", $value) > 0;
    }
}

